/**
 * 
 */
package com.java.test.user.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.java.test.controller.BaseController;
import com.java.test.user.dto.MemberGradeInfo;
import com.java.test.user.dto.MemberSliceInfo;
import com.java.test.user.service.MemberService;
import com.java.test.util.JsonResult;

/**
 * @author Administrator
 *
 */
@RestController
@RequestMapping("/select")
public class SelectItemController extends BaseController{

	@Autowired
	private MemberService memberservice;

	@RequestMapping("/optionList")
	public JsonResult ipList() {
		JSONObject obj = new JSONObject();
		JsonResult js = new JsonResult();
		// 下拉条件查询会员等级
		List<MemberGradeInfo> mgrade = memberservice.selectMemberGradeList();

		// 会员分层
		List<MemberSliceInfo> mslice = memberservice.selectMemberSliceList();

		obj.put("mgrade", mgrade);
		obj.put("mslice", mslice);

		js.setData(obj);
		return js;
	}
	
	
	
	/**
	 * 菜单
	 * @return
	 */
	@RequestMapping("/menuList")
	public JsonResult menuList() {
		JSONObject obj = new JSONObject();
		JsonResult js = new JsonResult();
		// 下拉条件查询会员等级
		List<MemberGradeInfo> mgrade = memberservice.selectMemberGradeList();

		// 会员分层
		List<MemberSliceInfo> mslice = memberservice.selectMemberSliceList();

		obj.put("mgrade", mgrade);
		obj.put("mslice", mslice);

		js.setData(obj);
		return js;
	}
	
	
	
	
	
	
	
	
	

}
